<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="<eq name="active" value="count">active</eq>"><a href="{:url('omg/agentCount')}">总统计</a></li>
			<li class="<eq name="active" value="week">active</eq>"><a href="{:url('omg/agentCount',array("oncheck"=>'week'))}">本周统计</a></li>
			<li class="<eq name="active" value="month">active</eq>"><a href="{:url('omg/agentCount',array("oncheck"=>'month'))}">本月统计</a></li>
		</ul>
        <form class="well form-inline margin-top-20" name="time" method="post" action="">
            <!-- <input type="text" class="form-control" name="domainname" style="width: 180px;" value="{:input('request.domainname/s','')}" placeholder="域名"> -->
            开始时间
            <input class="form-control js-bootstrap-date" type="text" name="star_time"
                                   value="">
            结束时间
            <input class="form-control js-bootstrap-date" type="text" name="end_time"
                                   value="">
            <!-- <input type="submit" class="btn btn-primary" value="导出表格" /> -->
            <!-- <a class="btn btn-danger" href="{:url('manage/domainList')}">清空</a> -->
            <button onclick="listshow()" class="btn btn-danger js-ajax-submit">查询</button>
            <button onclick="excelout()" class="btn btn-info js-ajax-submit">导出</button>
        </form>

        <div id="system" style="width: 800px;height:400px;" ></div>

		<table class="table table-hover table-bordered" style="width: 800px">
			<thead>
				<tr style="background: #6a6aff">
					<th>代理</th>
					<th>提交站数</th>
					<th>申户数</th>
					<th>下户站数</th>
					<th>下户站比率</th>
					<th>下户数</th>
					<th>下户数比率</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="all_agent" item="vo">
				<tr>
					<td>{$vo.name}</td>
					<td>{$vo.total_apply_domain_num }</td>
					<td>{$vo.total_apply_num }</td>
					<td>{$vo.total_down_domain_num}</td>
					<td>{$vo.down_domain_proportion}</td>
					<td>{$vo.total_down_num}</td>
					<td>{$vo.down_proportion}</td>
				</tr>
				</foreach>
				<tr style="background: #ff9797">
					<td>{$total_num.name}</td>
					<td>{$total_num.total_apply_domain_num }</td>
					<td>{$total_num.total_apply_num }</td>
					<td>{$total_num.total_down_domain_num}</td>
					<td></td>
					<td>{$total_num.total_down_num}</td>
					<td></td>
				</tr>
			</tbody>
		</table>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/js/echarts.js"></script>
	<script type="text/javascript">
	    // 基于准备好的dom，初始化echarts实例
	    var myChart2 = echarts.init(document.getElementById('system'));
	    var option2 = {
	        title : {
	            text: '代理下户数',
	            subtext: '实时数据',
	            x:'center'
	        },
	        tooltip : {
	            trigger: 'item',
	            formatter: "{a} <br/>{b} : {c} ({d}%)"
	        },
	        legend: {
	            orient: 'vertical',
	            left: 'left',
	            data: [<volist name="allAgent" id="agent">"{$agent['name']}",</volist>]
	        },
	        series : [
	            {
	                name: '代理',
	                type: 'pie',
	                radius : '55%',
	                center: ['50%', '60%'],
	                data:[<volist name="all_agent" id="count_agent" >{value:{$count_agent["total_down_num"]},name:"{$count_agent['name']}"},</volist>]
	            }
	        ]
	    };
	    myChart2.setOption(option2);
	</script>
	<script>
		//列表
	    function listshow(){
	        document.time.action="{:url('omg/agentCount')}";
	        document.time.submit();
	    }
	    //导出
	    function excelout() {
	        document.time.action = "{:url('omg/agentCountOut')}";
	        document.time.submit();
	    }
	</script>

</body>
</html>
